home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
tclMotif-1.4
/
programs
/
progDH4.4
< prev
next >
Wrap
Text File
|
1995-06-29
|
1KB
|
43 lines
# dan heller program 4.4, p108
# enter a command, execute it. place output in bottom window,
# command in history list
xtAppInitialize -class Program
xmMainWindow .main managed
# menu with one button in one pulldown
xmMenuBar .main.menuBar managed
xmCascadeButton .main.menuBar.file managed -labelString File
xmPulldownMenu .main.filePane
.main.menuBar.file setValues -subMenuId .main.filePane
xmPushButton .main.filePane.quit managed -labelString Quit
.main.filePane.quit activateCallback "exit 0"
xmScrolledText .main.text managed \
-rows 5 \
-columns 40 \
-editable False \
-editMode Multi_line_edit
# ?? dont know what dan is doing with userData
xmCommand .main.command managed -promptString "Command:"
.main.command commandEnteredCallback "exec_cmd {%value}"
.main setValues -menuBar .main.menuBar \
-commandWindow .main.command \
-workWindow [.main.text parent]
proc exec_cmd {command} {
set comm_output [eval exec $command]
.main.text setValues -value $comm_output
}
. realizeWidget
. mainLoop